package com.swuwen.ssh.hiring.service.impl;

import com.swuwen.ssh.hiring.dao.TalentDao;
import com.swuwen.ssh.hiring.entity.TalentEntity;
import com.swuwen.ssh.hiring.service.TalentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * 求职者业务实现
 */
@Service
public class TalentServiceImpl implements TalentService {
    @Autowired
    private TalentDao talentDao;

    @Override
    @Transactional
    public TalentEntity userLogin(String code, String password) {
        List<TalentEntity> list = talentDao.queryByCodeAndId(code, password);
        if (list == null || list.size() == 0) {
            return null;
        }
        return list.get(0);
    }
}
